package com.medicine.hbp.http;

import org.kymjs.kjframe.http.HttpParams;

import com.medicine.hbp.uitl.ToastUtil;

import android.app.Activity;
import android.content.Context;

/**
 * 数据访问集合
 *
 * @author yusuojindan
 *
 */
public class httpUitl {
	/**
	 * 提交用户分享信息接口
	 *
	 * @param title 分享标题
	 * @param msg 分享内容
	 * @param imgUrl 图片地址
	 * @param adUrl 推广地址
	 */
	public static void httpSaveShare(String id,String title, String msg, String imgUrl,
									 String adUrl, final Activity context) {
		HttpParams params = new HttpParams();
		params.put("title", title);
		params.put("msg", msg);
		params.put("artId", id);
		params.put("imgUrl", imgUrl);
		params.put("shareAddress", adUrl);
		AppHttps.HttpPost(context, HttpInterface.SAVE_SHARE, params,
				new AppHttpCallBack<Object>(Object.class) {
					@Override
					public void onSuccess(Object result) {
						ToastUtil.showShort(context, "分享保存成功");
					}

					public void onFailures(int errorCode, String errorMsg) {
						ToastUtil.showShort(context, "分享保存失败");
					}
				});

	}

	/**
	 * 提交用户分享信息接口
	 *
	 * @param title 分享标题
	 * @param msg 分享内容
	 * @param imgUrl 图片地址
	 * @param adUrl 推广地址
	 */
	public static void httpgx(String msg, final Activity context) {
		HttpParams params = new HttpParams();
		params.put("msg", msg);
		AppHttps.HttpPost(context, HttpInterface.SAVE_CARE_ABOUT, params,
				new AppHttpCallBack<Object>(Object.class) {
					@Override
					public void onSuccess(Object result) {
						ToastUtil.showShort(context, "关心保存成功");
					}

					public void onFailures(int errorCode, String errorMsg) {
						ToastUtil.showShort(context, "关心保存失败");
					}
				});

	}
}
